-
Notifications
You must be signed in to change notification settings - Fork 121
[Woo POS] Modularization: Extract FormattableAmountTextField, Coupon Creation, ProductImageThumbnail #16134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Woo POS] Modularization: Extract FormattableAmountTextField, Coupon Creation, ProductImageThumbnail #16134
Conversation
Generated by 🚫 Danger |
|
|
…d adaptor Provide access to FormattableAmountTextField and ViewModel for POS without making it as an explicit type dependency. FormattableAmountTextField cannot be easily moved and reused in a shared module due to multiple dependencies. This is used as a workaround to enable POS modularization without requiring a larger refactoring effort.
…aptor layer Coupon and Discount creation views belong to the Woo app target and contain a lot of Woo app dependencies that are hard to refactor. As a workaround, move the sheet creator to the adaptor layer and access type erased views through externalViews environment to build POSCouponCreationSheet.
b0ee9be to
68b32d6
Compare
…tion-shared-ui-components
|
@jaclync, as far as I detected, Coupons and FormattableAmountTextField should be the last two "complex" views that have to be reused this way on POS for now. |
jaclync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for keeping the PR small for easier review & testing.
I just noticed one image loading issue, but I don't think it's from the PR (it's reproducible from another branch as well, before the other refactoring PR was merged). It only happens in one iOS 18.4 iPad A16 simulator (built from Xcode 26), and I suspect it's a simulator issue.
| POS coupon creation | app coupon creation | order creation |
|---|---|---|
![]() |
![]() |
![]() |
as far as I detected, Coupons and FormattableAmountTextField should be the last two "complex" views that have to be reused this way on POS for now.
externalViews will act as a possible point where we may want to refactor to have truly independent POS UI-wise. In the PointOfSale module previews, we will see empty views for cash payment text field or for coupons add action for now.
Nice! And looks good to reuse this way for now. I foresee some refactoring in POS coupons if we plan to support coupons in Local Catalog i2 anyway.
WooCommerce/Classes/POS/Adaptors/View Adaptors/POSCouponCreationSheetAdaptor.swift
Outdated
Show resolved
Hide resolved
WooCommerce/Classes/POS/Presentation/PointOfSaleCollectCashView.swift
Outdated
Show resolved
Hide resolved
|
Also, feel free to let me know if I can help with any remaining tasks in WOOMOB-935 that you hadn't started. |
|
@jaclync thank you!
Yes, definitely! I'm on SR so I cannot progress much more this week. |
Co-authored-by: Jaclyn Chen <[email protected]>
…tion-shared-ui-components





Part of WOOMOB-935
Continuation of #16132
Description
Continue with UI components that need to be addressed to be able to move POS code into a separate module:
FormattableAmountTextFieldwhich has a dependency on a view model and a lot of business logic. I used the same pattern as with the support view, moving the implementation into an adaptor outside the POS and providing a type-erased version via the environment.Coupon Creationsame as with the amount text field. It's the whole feature of the Woo app that is reused on POS. Moving the logic outside the POS and accessing via the environment. Within the POS module previews, the empty implementation will be used.ProductImageThumbnailmoved toWooFoundationwith other UI componentsSteps to reproduce
Testing information
Tested on iPad Air 18.5 Simulator
Screenshots
Cash
Cash.Payment.iOS.18.Formattable.Text.Field.mov
Coupon Creation
Coupons.POS.Modularization.mov
RELEASE-NOTES.txtif necessary.